package com.gxa.eshop.service;

import com.gxa.eshop.exception.BusinessException;
import com.gxa.eshop.pojo.CartItem;

import java.util.Map;

/**
 * @author bill
 * @date 2022/1/20 10:35
 */
public interface CartService {

    /**
     * 添加商品到购物车
     * @param skuId
     * @param num
     */
    void addGoodsToCart(Long userId,String  skuId, Integer num)throws BusinessException;

    /**
     * 修改购物项数量
     * @param skuId
     * @param num
     */
    void updateCartItemNum(Long userId,String  skuId, Integer num);

    /**
     * 移除购物项
     * @param skuId
     */
    void removeCartItem(Long userId,String  skuId);

    /**
     * 清空购物车
     */
    void clearCart(Long userId);

    /**
     * 查询购物项
     * @param skuId
     * @return
     */
    CartItem queryUserCartItem(Long userId, String  skuId)throws BusinessException ;

    /**
     * 查询购物车
     * @return
     */
    Map queryUserCart(Long userId);
}